﻿@model GameSchoolApplication.Models.StudentAnswer
           
<li>
    <p>@Model.Question.Content</p>

    @Html.HiddenFor(model => model.QuestionId)
    @if (Model.Question.Answers.Count == 0)
    {
        <div class="editor-label">
            @Html.LabelFor(model => model.AnswerText)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.AnswerText)
            @Html.ValidationMessageFor(model => model.AnswerText)
        </div>
    }
    else
    { 
        <ul class="answers">
            @foreach (var answer in Model.Question.Answers)
            { 
                <li>
                    @Html.RadioButtonFor(model => model.AnswerId, answer.AnswerId, new { id = ("answer-" + answer.AnswerId) })
                    <label for="@("answer-" + answer.AnswerId)">@answer.Content</label>
                </li>
            }
        </ul>
    }
</li>
